class carStore(object):
    def __init__(self):
        self.factory = Factory()
    def order_Car(self,cartype):
       return self.factory.select_car_type(cartype)

class Factory(object):
    def select_car_type(self,cartype):
        if cartype=="宝马":
           return  BWM()
        elif cartype=="奥迪":
            return Aodi()
        elif cartype=="奔驰":
            return BeiChi()
class  Car(object):
    def __init__(self):
        self.name = ""
    def start(self):
        print("%s车开始启动啦"%self.name)

    def run(self):
        print("%s车开始跑啦"%self.name)

    def stop(self):
        print("%s车停下来啦"%self.name)

class BWM (Car):
    def __init__(self):
        self.name = "宝马"

class Aodi(Car):
    def __init__(self):
        self.name = "奥迪"
class BeiChi(Car):
    def __init__(self):
        self.name = "奔驰"

car_store = carStore()
car = car_store.order_Car("宝马")
car.start()